import request from '@/utils/request'

// 查询mqtt配置列表
export function listMqttConfig(query) {
  return request({
    url: '/tranShort/mqttConfig/list',
    method: 'get',
    params: query
  })
}

// 查询mqtt配置详细
export function getMqttConfig(id) {
  return request({
    url: '/tranShort/mqttConfig/' + id,
    method: 'get'
  })
}

// 新增mqtt配置
export function addMqttConfig(data) {
  return request({
    url: '/tranShort/mqttConfig',
    method: 'post',
    data: data
  })
}

// 修改mqtt配置
export function connect(data) {
  return request({
    url: '/tranShort/mqttConfig/connect',
    method: 'post',
    data: data
  })
}

// 删除mqtt配置
export function delMqttConfig(id) {
  return request({
    url: '/tranShort/mqttConfig/' + id,
    method: 'delete'
  })
}


// 查询单个mqtt配置
export function getInfo() {
  return request({
    url: '/tranShort//mqttConfig/getInfo',
    method: 'get'
  })
}

// 修改mqtt配置
export function connectTest(data) {
  return request({
    url: '/tranShort/mqttConfig/connectTest',
    method: 'post',
    data: data
  })
}
